/****************************************************************************
 *   This file is part of Q2D.                                              *
 *                                                                          *
 *   Q2D is free software: you can redistribute it and/or modify            *
 *   it under the terms of the GNU General Public License as published by   *
 *   the Free Software Foundation, either version 3 of the License, or      *
 *   (at your option) any later version.                                    *
 *                                                                          *
 *   Q2D is distributed in the hope that it will be useful,                 *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 *   GNU General Public License for more details.                           *
 *                                                                          *
 *   You should have received a copy of the GNU General Public License      *
 *   along with Q2D.  If not, see <http://www.gnu.org/licenses/>.           *
 *                                                                          *
 ****************************************************************************/

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "mysqlembeddeddatabase.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindowClass)
{
    ui->setupUi(this);
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));

    MySQLEmbeddedDatabase * db = new MySQLEmbeddedDatabase();

    tabWidget = new TabWidget();
    this->setCentralWidget(tabWidget);
    tabWidget->test();

    QCryptographicHash hash(QCryptographicHash::Md5);
    QByteArray array;

    array.append("hashThat!");
    QString resultStr(hash.result().toHex());
    qDebug(resultStr.toAscii());
    array.append("haasas");
    resultStr = (hash.result().toHex());
    qDebug(resultStr.toAscii());
    array.append("ezfdas");
    hash.addData(array);
    resultStr = (hash.result().toHex());
    qDebug(resultStr.toAscii());

}

MainWindow::~MainWindow()
{
    delete ui;
}
